using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;using THSERP.BusinessEntities;using THSERP.BaseProvider;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using THSLib;using THSERP.BaseProvider;

namespace THSERP.Modules.CompanyConstant
{
    public partial class guiConfigCustomerOrderType : THSERPScreen
    {
        public DataTable tblConfigCustomerOrderType = new DataTable();
        public guiConfigCustomerOrderType()
        {
            InitializeComponent();
        }

        private void guiConfigCustomerOrderType_Load(object sender, EventArgs e)
        {
            tblConfigCustomerOrderType = ADConfigValueUtility.InitConfigValueTable(ADConfigValueUtility.ADConfigValueCustomerOrderType);
            fld_dgcCustomerOrderType.DataSource = tblConfigCustomerOrderType;
        }

        public void SaveConfigCustomerOrderType()
        {
            foreach (DataRow rowCustomerOrderType in tblConfigCustomerOrderType.Rows)
            {
                String strKey = rowCustomerOrderType["Value"].ToString();
                String strText = rowCustomerOrderType["Text"].ToString();
                if (!String.IsNullOrEmpty(strKey))
                    ADConfigValueUtility.UpdateValueToADConfigValueTable(strKey, strText);
            }
        }

        private void fld_btnSave_Click(object sender, EventArgs e)
        {
            SaveConfigCustomerOrderType();
            MessageBox.Show("Gespeichert", "#Message#");
        }

        private void fld_btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}